<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }

      ul,
      ol,
      li {
        list-style: none;
      }

      body {
        cursor: url("./img/pen/pen32.ico") 0 32, auto;
      }

      .canvas-list {
        position: relative;
      }

      .canvas-list #canvas1 {
        position: absolute;
        top: 0;
        left: 0;
      }

      .canvas-list #canvas2 {
        position: absolute;
        top: 0;
        left: 0;
      }

      .tools,
      .tools-options {
        position: relative;
        top: 0;
        left: 0;
        /* width: 100%; */
        width: 300px;
        margin: 0 auto;
        user-select: none;
      }

      .tools-options {
        position: fixed;
        top: 0;
        left: 0;
        margin-top: 70px;
        width: 70px;
        /* height: 100%; */
        /* background-color: orange; */
      }

      .tools div {
        display: inline-block;
        margin: 15px 10px;
        width: 50px;
        height: 50px;
        transition: all 0.5s;
      }

      .tools img {
        width: 50px;
        height: 50px;
      }

      .tools .active {
        transform: scale(1.3);
      }

      .tools #pen:hover {
        transform: rotate(-45deg);
      }

      .tools #eraser:hover {
        transform: rotate(-45deg);
      }

      .tools #clear:hover {
        transform: rotate(-45deg);
      }

      .tools #save {
        transform: rotate(-35deg);
      }

      .tools #save:hover {
        transform: rotate(4deg);
      }

      .tools div {
        padding-bottom: 0;
        margin-bottom: 0;
        transition: all 0.5s;
      }

      /* ---------------------------- */
      .line-color {
        position: fixed;
        top: 70px;
        left: 15px;
      }

      li {
        width: 30px;
        height: 30px;
        border-radius: 15px;
        margin: 20px;
        transition: all 0.5s;
      }

      .line-color li:nth-child(1) {
        background-color: #000000;
      }

      .line-color li:nth-child(2) {
        background-color: #093d64;
      }

      .line-color li:nth-child(3) {
        background-color: #fb6602;
      }

      .line-color li:nth-child(4) {
        background-color: #dc3972;
      }

      .line-color li:nth-child(5) {
        background-color: #34adae;
      }

      .line-color li:nth-child(6) {
        background-color: #fd8f52;
      }

      .line-color li:nth-child(7) {
        background-color: #78932c;
      }

      .line-color li:nth-child(8) {
        background-color: #555555;
      }

      .line-color .active {
        transform: scale(1.4);
      }

      .line-weight {
        position: fixed;
        top: 70px;
        left: 70px;
      }

      .line-weight li {
        display: block;
        width: 40px;
        margin: 20px 0 0 20px;
        background-color: black;
      }
      .line-weight li:nth-child(1) {
        height: 10px;
      }
      .line-weight li:nth-child(2) {
        height: 15px;
      }
      .line-weight li:nth-child(3) {
        height: 20px;
      }
      .line-weight li:nth-child(4) {
        height: 25px;
      }
      .line-weight .active {
        width: 60px;
      }

      .eraser-width {
        display: none;
      }
      .eraser-width li {
        display: block;
        width: 64px;
        height: 64px;
        margin: 0 0 0 30px;
      }
    </style>
  </head>

  <body>
    <div class="canvas-list">
      <!-- 多层canvas : canvas1为静态背景, canvas2为动作 -->
      <canvas id="canvas1"></canvas>
      <canvas id="canvas2"></canvas>
    </div>
    <div class="tools">
      <div class="pen active" id="pen">
        <img src="./img/tools/pen.svg" alt="" />
      </div>
      <div class="eraser disactive" id="eraser">
        <img src="./img/tools/eraser.svg" alt="" />
      </div>
      <div class="clear" id="clear">
        <img src="./img/tools/brush.svg" alt="" title="清空画布" />
      </div>
      <div class="save" id="save">
        <img src="./img/tools/picture.svg" alt="" title="保存图片" />
      </div>
    </div>
    <div class="tools-options">
      <ol class="line-color">
        <li id="color1" color="#000000" class="active"></li>
        <li id="color2" color="#093D64"></li>
        <li id="color3" color="#FB6602"></li>
        <li id="color4" color="#DC3972"></li>
        <li id="color5" color="#34ADAE"></li>
        <li id="color6" color="#FD8F52"></li>
        <li id="color7" color="#78932C"></li>
        <li id="color8" color="#555555"></li>
      </ol>
      <ol class="line-weight">
        <li weight="10"></li>
        <li weight="15" class="active"></li>
        <li weight="20"></li>
        <li weight="25"></li>
      </ol>
      <ol class="eraser-width">
        <li id="eraser16" eraser="16">
          <img src="./img/eraser/eraser16.ico" alt="" />
        </li>
        <li id="eraser32" eraser="32" class="active">
          <img src="./img/eraser/eraser32.ico" alt="" />
        </li>
        <li id="eraser48" eraser="48">
          <img src="./img/eraser/eraser48.ico" alt="" />
        </li>
        <li id="eraser64" eraser="64">
          <img src="./img/eraser/eraser64.ico" alt="" />
        </li>
      </ol>
      <ol class="background-color"></ol>
    </div>
    <script type="module" src="./js/index.js"></script>
  </body>
</html>
